<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }

        .tu {
            width: 650px;
            z-index: 2;
            height: 480px;
            float: left;
        }

        #ans3 {
            width: 800px;
            z-index: 2;
            height: 480px;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">第二轮</li>
            <li>第三轮</li>
        </ul>
    </div>
    <div class="layui-tab-content" id="content0">
        <div class="tu" id="ans2_1">
        </div>
        <div class="tu" id="ans2_2">
        </div>
    </div>
    <div class="layui-tab-content" id="content1" style="display: none;">
        <div id="ans3">
        </div>
    </div>
    </div>
    <script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="js/echarts.js" ,type="text/javascript"></script>
    <script src="js/jquery-3.1.1.min.js" ,type="text/javascript"></script>
    <script>
        layui.use(['form'], function () {
            var form = layui.form,
                layer = layui.layer,
                table = layui.table,
                $ = layui.$;
            $('.layui-tab-title').children('li').on('click', function () {
                var index = $('.layui-tab-title').children('li').index(this);
                for (var i = 0; i <= 1; i++) {
                    if (i == index) {
                        $('.layui-tab-content').css('display', 'none');
                        var name = '#' + 'content' + i;
                        $(name).css('display', 'block');
                    }
                }
            })
            $(function () {
                $.get('/xietiao', {
                    question: '2_1'
                }, function (re) {
                    data = re.list
                    console.log(data)
                    var option2_1 = {
                        title: {
                            text: '专家回答协调程度————预测返校所需条件',
                            left: 'center'
                        },
                        xAxis: {
                            data: ['21天所在地无病历', '14天所在地无病历', '7天所在地无病历'],
                            name: "预测问题"
                        },
                        yAxis: {
                            name: "协调程度",
                            minInterval: 1
                        },
                        series: [{
                                type: 'bar',
                                data: data,
                                label: {
                                    show: true,
                                    position: 'top'
                                },
                            },
                            {
                                type: 'line',
                                data: data
                            }
                        ]
                    }
                    var mychart2_1 = echarts.init(document
                        .getElementById('ans2_1'));
                    mychart2_1.setOption(option2_1);
                })
                $.get('/xietiao', {
                    question: '2_2'
                }, function (re) {
                    data = re.list
                    console.log(data)
                    var option2_2 = {
                        title: {
                            text: '专家回答协调程度————预测返校后隔离政策',
                            left: 'center'
                        },
                        xAxis: {
                            data: ['14天集中隔离+7天宿舍隔离', '7天集中隔离+7天宿舍隔离', '7天宿舍隔离', '不隔离'],
                            name: "预测问题"
                        },
                        yAxis: {
                            name: "协调程度",
                            minInterval: 1
                        },
                        series: [{
                                type: 'bar',
                                data: data,
                                label: {
                                    show: true,
                                    position: 'top'
                                },
                            },
                            {
                                type: 'line',
                                data: data
                            }
                        ]
                    }
                    var mychart2_2 = echarts.init(document
                        .getElementById('ans2_2'));
                    mychart2_2.setOption(option2_2);
                })
                $.get('/xietiao', {
                    question: '3'
                }, function (re) {
                    data = re.list
                    console.log(data)
                    var option3 = {
                        title: {
                            text: '专家回答协调程度————预测下学期返校时间',
                            left: 'center'
                        },
                        xAxis: {
                            data: ['正常返校', '10月返校', '11月返校', '12月返校', '不返校'],
                            name: "预测问题"
                        },
                        yAxis: {
                            name: "协调程度",
                            minInterval: 1
                        },
                        series: [{
                                type: 'bar',
                                data: data,
                                label: {
                                    show: true,
                                    position: 'top'
                                },
                            },
                            {
                                type: 'line',
                                data: data
                            }
                        ]
                    }
                    var mychart3 = echarts.init(document
                        .getElementById('ans3'));
                    mychart3.setOption(option3);
                })
            })
        })
    </script>
</body>

</html>